# include(CTest)

# set test build target name
set(target_name qbe)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)


file(GLOB_RECURSE SRC_FILES
    ./src/adsorb/*
    ./src/axis/*
    ./src/canvas/*
    ./src/draw/*
    ./src/ecs/*
    ./src/input/*
    ./src/layout/*
    ./src/layer/*
    ./src/render/*
    ./src/library/*
    ./src/message/*
    ./src/select/*
    ./src/utils/*
    ./src/tools/*
    ./src/image2d/*
    ./src/observe/*
    ./src/operationLayer/*

    ./src/drawingBoard/auxiliary/*

    ./src/state/*

    ./src/undoRedo/*

    ./src/editing/*

    ./src/ui/*
)


# # add lib
add_library(${target_name} ${SRC_FILES})

# # target_compile_definitions(${target_name} PRIVATE QLE_EXPORTS)

target_include_directories(${target_name} PRIVATE 
    # self
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_SOURCE_DIR}/src
    ${QLIB_SOURCE_DIR}

    ${VCPKG_SDK}/include 
    ${VCPKG_SDK}/include/qt5
)

target_link_libraries(${target_name} PRIVATE qmessage)
target_link_libraries(${target_name} PRIVATE qlib)

# ##--> Qt5 link libs
find_package(QT NAMES Qt5 REQUIRED COMPONENTS Widgets Concurrent)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Concurrent)
target_link_libraries(${target_name} PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Concurrent)

# link_libraries(
#     # $ENV{PYTHONHOME}/libs/python310.lib
# )

# # 启动单元测试
enable_testing()
add_subdirectory(tests)